﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using EcssTool.Utility;
using EcssTool.Logic;
using System.Threading;

namespace ECSS.Winform
{
    public partial class FrmFinishServicesFail : Form
    {
        private List<string> serviceDeliverIds;

        public FrmFinishServicesFail()
        {
            InitializeComponent();
        }

        private void btnStart_Click(object sender, EventArgs e)
        {
            serviceDeliverIds = new InputHelper().GetTargetInTextBox(textBox1);

            ServiceDeliverHelper sdhelper = new ServiceDeliverHelper();

            StringBuilder sb = new StringBuilder();

            if (serviceDeliverIds != null)
            {
                foreach (string deliverId in serviceDeliverIds)
                {
                    sb.Append(sdhelper.FixFailureService(deliverId) + "\r\n");

                    Thread.Sleep(500);
                }

                textBox2.Text = sb.ToString();
            }
        }
    }
}
